<?php
	$sql = 'SELECT * FROM '.Tbladvertise::tbladvertise.'  WHERE  '.Tbladvertise::status.' = 1  AND  '.Tbladvertise::page.' = 1  AND ' .Tbladvertise::position. ' = "left" ORDER BY '.Tbladvertise::date_modified.' ';
	$result = mysql_query($sql);
	if(mysql_num_rows($result)>0){
	 	while ($row = mysql_fetch_object($result)) {
			if(strtotime($row->{Tbladvertise::dateendpost}) > strtotime(date("Y-m-d"))){
				echo '<div class="box laster custom">
				    		<div class="box-content">
				        		<div class="product-grid" style="padding:10px;;"> ';
			?>
			<div class="image" >
				<a href="<?php echo $row->{Tbladvertise::link} ?>" target="_blank" alt="<?php echo $row->{Tbladvertise::link} ?>" title="<?php echo $row->{Tbladvertise::link} ?>">
					<img class="image_product_tap" src="<?php echo 'images/advertise/' . $row->{Tbladvertise::image} . '"'; ?>" style="margin:auto;width:100%;"/>
				</a>
			</div><p></p>
		<?php
				echo '</div>
		    </div>
		</div>';
 			}
//  else{
// 				echo '<div class="image" style="overflow:hidden;text-align:center;border:1px solid #ccc;">';
// 				echo '<a href="#"><img class="image_product_tap" src="images/advertise/home_right_default_advertise.png" style="margin:auto;width:100%;border:0px solid #063;" /></a>';
// 				echo '</div><p></p>';
				
// 				echo '<div class="image" style="overflow:hidden;text-align:center;border:1px solid #ccc;">';
// 				echo '<a href="#"><img class="image_product_tap" src="images/advertise/home_right_default_advertise.png" style="margin:auto;width:100%;border:0px solid #063;" /></a>';
// 				echo '</div><p></p>';
// 			}
		}
	 }
?>